<%@ page import="com.psl.model.file" %>
<%@ page import="com.psl.model.userlogin" %>
<%@ page import="com.psl.services.frame.fileUploadServices" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String order_id = request.getParameter("order_id");%>
<%
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="http://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/assets/js/jquery-1.8.2.min.js"></script>
    <style>
        .order {
            border: 1px solid #00D2D2;
            border-top-width: 0
        }

        .order td {
            border: 1px solid #00D2D2;
            border-top-width: 0
        }
         body{
             font-size: 16px;
         }
    </style>
</head>

<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <td width="1%" align="center" background="/assets/img/b2.jpg"><img src="/assets/img/b1.jpg" width="10"
                                                                             height="26"></td>
        <td width="99%" background="/assets/img/b2.jpg">
            <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
                <tbody>
                <tr>
                    <td width="100" align="center" class="biao">订单文件上传</td>
                </tr>
                </tbody>
            </table>
        </td>
        <td width="1%" align="right" background="/assets/img/b2.jpg"><img src="/assets/img/b3.jpg" width="9"
                                                                            height="26"></td>
    </tr>
    </tbody>
</table>


<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#AEDEF4" class="order">
    <tbody>
    <tr height="25" align="center" bgcolor="#FFF9DF">
        <td height="25" align="center" bgcolor="#FFF9DF" colspan="3">订单号<input type="text" value=""><input type="submit"
                                                                                                           value="查询">
        </td>
        <td height="25" align="center" bgcolor="#FFF9DF" colspan="8">按日期查询：<input type="date" value=""
                                                                                  placeholder="开始日期">---<input
                type="date" value="" placeholder="结束日期"><input type="submit" value="查询"></td>
    </tr>
    <tr>
        <td height="25" align="center" bgcolor="#D6F2FD" colspan="12"></td>
    </tr>
    <tr>
        <td height="25" align="center" bgcolor="#FFF9DF" colspan="4">订单号</td>
        <td align="center" bgcolor="#FFF9DF" colspan="4">相关文件</td>
        <td align="center" bgcolor="#FFF9DF" colspan="3">上传日期</td>
    </tr>
    <%
        fileUploadServices fus = new fileUploadServices();
        List f = fus.Orderfilelist(order_id);
        Iterator iter = f.iterator();
        file file = null;
        while (iter.hasNext()) {
            file = (file) iter.next();%>
    <tr>
        <td height="25" align="center" bgcolor="#FFFFFF" class="hebing" colspan="4"><%=file.getOrder_id()%></td>
        <td height="25" align="center" bgcolor="#FFFFFF"  colspan="4" ><a href="/servlet/DownloadServlet?fileName=<%=file.getFileName()%>&fileUUid=<%=file.getFileUUid()%>&filetype=<%=file.getFiletype()%>"><%=file.getFileName()%></a></td>
        <td height="25" align="center" bgcolor="#FFFFFF"  colspan="3" ><%=file.getDate()%></td>
    </tr>
    <%}%>
    </tbody>
</table>

<script>
    $(function(){
        $('.hebing').each(function(index, element) {
            if(!$(this).hasClass('hide'))
            {    var next=$(this).parent('tr').next('tr').children('.hebing');//下一个合并的对象
                $(this).attr('rowspan',1);
                while($(this).text()==next.text())
                {
                    $(this).attr('rowspan',parseInt($(this).attr('rowspan'))+1);
                    next.hide();
                    next.addClass('hide');
                    next=next.parent('tr').next('tr').children('.hebing');//下一个合并的对象
                }
            }
        });
    });
</script>
<script src="http://cdn.bootcss.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
</body>
</html>